﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="ManageCourses.aspx.cs" Inherits="UI.ManageCourses" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="server">
    <div class="topManageCourses">
        <table>
            <tr>
                <td>
                    <asp:Button runat="server" Width="150px" Text="Gérer les formateurs" />
                </td>
                <td>
                    <asp:Button runat="server" Width="150px" Text="Ajouter une formation" ID="AddFormation" OnClick="AddFormation_OnClick" CausesValidation="false" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button runat="server" Width="150px" Text="Inscrire un stagiare" />
                </td>
                <td>
                    <asp:Button runat="server" Width="150px" Text="Planifier une formation" ID="PlanAFormation" OnClick="PlanAFormation_OnClick" CausesValidation="false" />
                </td>
            </tr>
        </table>
    </div>
    <br />
    <div class="contentManageCourses">
        <asp:GridView ID="GridViewFormations" runat="server" 
            AutoGenerateColumns="False" 
            OnRowEditing="GridViewFormations_OnRowEditing" 
            OnRowCancelingEdit="GridViewFormations_OnRowCancelingEdit"
            OnRowDataBound="GridViewFormations_OnRowDataBound"
            OnRowUpdating="GridViewFormations_OnRowUpdating"
            OnRowDeleting="GridViewFormations_OnRowDeleting" 
            onselectedindexchanged="GridViewFormations_SelectedIndexChanged">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowCancelButton="true" />
                
                <asp:TemplateField HeaderText="Identifiant" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:Label ID="lblIdentifiantEditView" runat="server" Text='<%# Bind("Identifiant") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblIdentifiant" runat="server" Text='<%# Eval("Identifiant") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Reference" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbReference" runat="server" Text='<%# Bind("Reference") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblReferemce" runat="server" Text='<%# Eval("Reference") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Libelle" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbLibelle" runat="server" Text='<%# Bind("Libelle") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblLibelle" runat="server" Text='<%# Eval("Libelle") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Nombre Jours" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbNombreJours" runat="server" Text='<%# Bind("NombreJours") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblNombreJours" runat="server" Text='<%# Eval("NombreJours") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Prix" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbPrix" runat="server" Text='<%# Bind("Prix") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblPrix" runat="server" Text='<%# Eval("Prix") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Description" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbDescription" runat="server" Text='<%# Bind("Description") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Theme" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlTheme" runat="server" DataTextField="Libelle" DataValueField="Identifiant" />
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblDisplayTheme" runat="server" Text='<%# Eval("DisplayTheme") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="contentManageCoursesPlanned">
        <asp:GridView ID="GridViewFormationsPlanned" runat="server" 
            AutoGenerateColumns="False" 
            OnRowEditing="GridViewFormationsPlanned_OnRowEditing" 
            OnRowCancelingEdit="GridViewFormationsPlanned_OnRowCancelingEdit"
            OnRowDataBound="GridViewFormationsPlanned_OnRowDataBound"
            OnRowUpdating="GridViewFormationsPlanned_OnRowUpdating"
            OnRowDeleting="GridViewFormationsPlanned_OnRowDeleting">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowCancelButton="true" />
                
                <asp:TemplateField HeaderText="Identifiant" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:Label ID="lblIdentifiantEditView" runat="server" Text='<%# Bind("Identifiant") %>'/>
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblIdentifiant" runat="server" Text='<%# Eval("Identifiant") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Date Depart" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbDateDebut" runat="server" Text='<%# Bind("DateDebutDisplay") %>'/>
                        <asp:CalendarExtender ID="ceDateDebut" runat="server"  TargetControlID="tbDateDebut" />
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblDateDebut" runat="server" Text='<%# Eval("DateDebutDisplay") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Date Fin" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="tbDateFin" runat="server" Text='<%# Bind("DateFinDisplay") %>'/>
                        <asp:CalendarExtender ID="ceDateFin" runat="server" TargetControlID="tbDateFin" />
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblDateFin" runat="server" Text='<%# Eval("DateFinDisplay") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Formateurs" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlFormateurs" runat="server" DataTextField="FormateurName" DataValueField="Identifiant" />
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblFormateurs" runat="server" Text='<%# Eval("FormateurName") %>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField  HeaderText="Formations" HeaderStyle-HorizontalAlign="Left"> 
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlFormations" runat="server" DataTextField="FormationName" DataValueField="Identifiant" />
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="lblFormations" runat="server" Text='<%# Eval("FormationName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

    </div>
</asp:Content>
